package deepr.src.graph;

import deepr.anno.SchemaType;
import deepr.core.DisposeContext;
import lombok.Data;

import java.util.HashMap;
import java.util.HashSet;

@Data
public class GraphDisposeContext extends DisposeContext {
  private String optional = "OPTIONAL ";
  private HashSet<String> appear = new HashSet<>();
  private HashMap<String, String[]> match = new HashMap<>();
  private HashMap<String, String[]> opMatch = new HashMap<>();

  public GraphDisposeContext() {
    setSchemaType(SchemaType.NEO4J);
  }


  public void addAppear(String object) {
    this.appear.add(object);
  }

  public boolean appearContains(String object) {
    return appear.contains(object);
  }

  public boolean foreignExists(String object) {
    return match.get(object) != null || opMatch.get(object) != null;
  }

}
